/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.unesp.ia.gridsolver.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Pardal
 */
@Embeddable
public class SlotmateriaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "Materia", nullable = false)
    private int materia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Slot", nullable = false)
    private int slot;

    public SlotmateriaPK() {
    }

    public SlotmateriaPK(int materia, int slot) {
        this.materia = materia;
        this.slot = slot;
    }

    public int getMateria() {
        return materia;
    }

    public void setMateria(int materia) {
        this.materia = materia;
    }

    public int getSlot() {
        return slot;
    }

    public void setSlot(int slot) {
        this.slot = slot;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) materia;
        hash += (int) slot;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SlotmateriaPK)) {
            return false;
        }
        SlotmateriaPK other = (SlotmateriaPK) object;
        if (this.materia != other.materia) {
            return false;
        }
        if (this.slot != other.slot) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.unesp.ia.gridsolver.entity.SlotmateriaPK[ materia=" + materia + ", slot=" + slot + " ]";
    }
    
}
